<template>
	<div>
		<el-card class="!border-none pt-4" shadow="never">
			<el-form class="ls-form el-set-form" :model="formData" inline>
				<el-form-item label="角色名称">
					<el-input class="w-[240px]" placeholder="请输入角色名称" v-model="formData.title" clearable />
				</el-form-item>
				<el-form-item label="角色状态">
					<el-select class="w-[120px]" v-model="formData.type" placeholder="请选择">
						<el-option v-for="(item, index) in visitType" :key="index" :label="item.label"
							:value="item.value" />
					</el-select>
				</el-form-item>
				<el-form-item>
					<el-button class="main-color1 w-[76px] h-[36px]">重置</el-button>
					<el-button class="w-[76px] h-[36px]" color="#0054A6" type="primary">查询</el-button>
				</el-form-item>
			</el-form>
		</el-card>
		<el-card class="!border-none pt-4 mt-[20px]" shadow="never">
			<div class="text-right">
				<el-button class="w-[76px] h-[36px]" color="#0054A6" type="primary">
					<router-link :to="{
					        path: getRoutePath('department.department/architectureAdd'),
					        query: {
					            id:1
					        }
					    }">
						<span>添加</span>
					</router-link>
				</el-button>
			</div>
			<el-table class="mt-[20px]" size="large" :data="lists"
				:header-cell-style="{'background':'#0054A6','color':'#FFB400','line-height':'52px','padding':'14px 0'}"
				:cell-style="{'color':'#0054A6','padding':'20px 0'}">
				<el-table-column label="编号" prop="scene_name" align="center">
					<template #default="{ row }">
						<el-button type="primary" link>
							<router-link :to="{
					                path: getRoutePath('message.message/detail'),
					                query: {
					                    id: row.id
					                }
					            }">
								<span class="main-color">111</span>
							</router-link>
						</el-button>
					</template>
				</el-table-column>
				<el-table-column label="角色名" prop="管理员1" align="center" />
				<el-table-column label="创建时间" prop="2023-09-05 11:30:32" align="center" />
				<el-table-column label="状态" prop="scene_name" align="center">
					<template #default="{ row }">
						<el-switch v-model="value" class="ml-2"
							style="--el-switch-on-color:#0256A7; --el-switch-off-color: #CED1D6" />
					</template>
				</el-table-column>
				<el-table-column label="操作" fixed="right" align="center">
					<template #default="{ row }">
						<el-button type="primary" link >
							<router-link :to="{
							        path: getRoutePath('message.message/detail'),
							        query: {
							            id: row.id
							        }
							    }">
								<span class="main-color1">编辑</span>
							</router-link>
						</el-button>
						<el-button type="primary" link @click="handleDelete(row.id)">
							<span class="main-color1">删除</span>
						</el-button>
					</template>
				</el-table-column>
			</el-table>
			<div class="p-[20px] v-flex v-row-right">
				<el-pagination background layout="prev, pager, next" :default-page-size="6" :total="1000"
					:pager-count="6" />
			</div>
		</el-card>
	</div>
</template>

<script lang="ts" setup>
	import { getRoutePath } from '@/router'
	import feedback from '@/utils/feedback'
	const formData = reactive({
		title: '',
		type:''
	})
	const lists = ref<Array<any>>([
		{}, {}, {}
	])
	// 产品分类
	const visitType = ref<Array<any>>([
		{
			label: '所有',
			value: ''
		},
		{
			label: '开启',
			value: '0'
		},
		{
			label: '关闭',
			value: '1'
		}
	])
	const handleDelete = async (id : number) => {
		await feedback.confirm('确定要删除该信息吗？')
		// await menuDelete({ id })
		// getLists()
	}
</script>

<style scoped lang="scss">
	.el-set-form:deep() .el-form-item__label {
		color: var(--el-text-color-main);
		height: 36px;
		line-height: 36px;
	}

	.el-set-form:deep() .el-input__inner {
		height: 36px;
	}

	.el-set-form:deep() .el-input__inner::placeholder {
		color: var(--el-text-color-main);
	}

	.el-tabs__item.is-active {
		color: var(--el-text-color-main);
		font-weight: bold;
	}

	.el-tabs__nav-wrap::after {
		background-color: #F5F5F5;
	}

	.el-tabs__active-bar {
		background-color: var(--el-text-color-main);
	}

	:deep() .el-pagination.is-background .el-pager li.is-active {
		background-color: var(--el-text-color-main);
	}
</style>